<extend name="Public:base"/>


<block name="left">
	<ul>
		<li><a href="{:U('Person/welcome')}">我的欢迎页面</a></li>
		<li><a href="{:U('Person/sign')}"><i><img src="__IMG__/logo/qd.png"  width="32" alt=""></i>&nbsp 签到</a></li>
		
	</ul>
</block>

<block name="right">
	 <div class="container clearfix">
            <div class="member_main">
                <table  class='table_sign'>
                    <thead>
                        <tr class="head">
                            <th>周日</th>
                            <th>周一</th>
                            <th>周二</th>
                            <th>周三</th>
                            <th>周四</th>
                            <th>周五</th>
                            <th>周六</th>
                        </tr>
                    </thead>
                    <tbody id="signrili">
                        <notempty name='blankArr'>
                            <tr>
                                <foreach name="blankArr" item="row">
                                    <td>-</td>
                                    <if condition="$row%7  eq $first"></tr></if>
                                </foreach>
                        </notempty>
                        <foreach name="days" item="row">
                            <if condition="$row['key2']  eq 0"><tr></if>
                            {$row['key']|getSign=###}
                            <if condition="$row['key2']  eq 7"></tr></if>
                        </foreach>
                        <foreach name="other" item="row">
                            <td>-</td>
                        </foreach>
                    </tbody>
                </table>
            </div>
        </div>

        <script type="text/javascript">
            function signDay(obj) {
                $.post("{:U('Person/signDay')}", {}, function(data) {
                    if(data == -1){
                        alert("请登录！");return false;
                    }
                    var num = obj.find("span").text();
                    var td = "<td  style='background-color:navajowhite;navajowhite ;'>\n\
                       <div align='right' valign='top'><span style='position:relative;right:20px;'>" + num + "</span></div>\n\
                       <div align='left'><img width='35px' height='35px' src='/Public/Home/images/k/gou.png' alt='已签到' style='position:relative;left:10px;'>\n\
                        已签到</div></td>";
                    obj.before(td);
                    obj.remove();
                    if (data > 0) {
                        alert("签到成功获取 " + data + " 积分");
                    } else {
                        alert("今天您已签到！");
                    }
                })
            }
        </script>

</block>
